<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<#include "lib/lib.html" />
<title>管理员管理</title>
</head>
<body>
	<nav class="breadcrumb">
	 	 <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 管理员管理
		 <a  class="btn btn-success radius r mr-20"  style="line-height: 1.6em; margin-top: 3px" href="javascript:location.replace(location.href);" title="刷新">
		 <i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="pd-20 text-c">
		<div class="text-c">
			<input type="text" name="" id="" placeholder="应用名称、id" style="width: 250px" class="input-text">
			<button name="" id="" class="btn btn-success" type="submit"> <i class="Hui-iconfont">&#xe665;</i> 搜索 </button>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="l">
				<a href="javascript:;" onclick="datadel()"  class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> 
				<a class="btn btn-primary radius" onclick="adm_add('添加管理员','/admin/goaddadm.do')" href="javascript:;">
				<i class="Hui-iconfont">&#xe600;</i> 添加管理员</a></span> <span class="r"> 
			</span>
		</div>
		<div class="mt-20">
			<div id="page" class="holder"></div>  
			<table class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						<th width="25"><input type="checkbox" name="" value=""></th>
						<th width="80">用户名</th>
						<th width="80">用户类型:</th>
						<th>真实姓名</th>
						<th>手机号码</th>
						<th width="150">用户状态</th>
						<th width="150">创建时间</th>
						<th width="150">操作</th>
					</tr>
				</thead>
				<tbody>
					<#if list.dataList?? && list.dataList?size gt 0>
					<#list list.dataList as dl >
						<tr class="text-c">
							<td><input type="checkbox" value="${dl.id}" name=""></td>
							<td>${dl.admName!}</td>
							<td>${dl.admType!}</td>
							<td>${dl.admDisplayName!}</td>
							<td>${dl.admTel!}</td>
							<td>
								<#if dl.admStatus==0>
									<span class="label label-success radius">已启用</span>
								<#else>
									<span class="label radius">已停用</span>
								</#if>
							</td>
							<td>${dl.createTime?string('yyyy-MM-dd')}</td>
							<td class="td-manage">
								<#if dl.admStatus==0>
								<a style="text-decoration:none" onClick="adm_stop(this,'${dl.id!}')" href="javascript:;" title="停用"><i class="Hui-iconfont">&#xe60e;</i></a> 
								<#else>
								<a style="text-decoration:none" onClick="adm_start(this,'${dl.id!}')" href="javascript:;" title="启用"><i class="Hui-iconfont">&#xe605;</i></a>
								</#if>
								<a title="编辑" href="javascript:;" onclick="adm_edit('管理员编辑','${basePath}/admin/goaddadm.do?id=${dl.id!}','1','800','500')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a> 
								<a title="删除" href="javascript:;" onclick="adm_del(this,${dl.id!})" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
						</tr>
					</#list>
					</#if>
				</tbody>
			</table>
		</div>
	</div>
	<script type="text/javascript">
	
	 //分页
	 $(function(){  
		$("#page").jPages({  
		containerID : "itemContainer",  
		previous : "←",  
		next : "→",  
		perPage : 20,  
		delay : 100  
		 });  
	 }); 
		/*系统-管理员-添加*/
		function adm_add(title, url, w, h) {
			layer_show(title, url, w, h);
		}
		
		/*系统-管理员-编辑*/
		function adm_edit(title, url, id, w, h) {
			layer_show(title, url, w, h);
		}
		
		/*系统-管理员-删除*/
		function adm_del(obj, id) {
			layer.confirm('确认要删除吗？', function(index) {
				var data = {};
				data.id = id;
				//后台请求保存数据
				$.axse("${basePath}/admin/deladm.do",  data, function(d){
					if(d.resultCode == 200){
						$(obj).parents("tr").remove();
						layer.msg('已删除!', {
							icon : 1,
							time : 1000
						});
					}else{
						layer.msg('删除失败,请重试!', {
							icon : 1,
							time : 1000
						});
					}
				},
				function(d){
					layer.msg('删除失败,请重试!', {
						icon : 1,
						time : 1000
					});
				});
			});
		}
		
		/*系统-管理员-停用*/
		function adm_stop(obj, id) {
			layer.confirm('确认要锁定吗？', function(index) {
				var data = {};
				data.id = id;
				//后台请求保存数据
				$.axse("${basePath}/admin/stopadm.do",  data, function(d){
					if(d.resultCode == 200){
						layer.msg('已锁定!', {
							icon : 1,
							time : 1000
						});
						location.replace(location.href);
					}else{
						layer.msg('锁定失败,请重试!', {
							icon : 1,
							time : 1000
						});
					}
				},
				function(d){
					layer.msg('锁定失败,请重试!', {
						icon : 1,
						time : 1000
					});
				});
			});
		}
		
		/*系统-管理员-启用*/
		function adm_start(obj, id) {
			layer.confirm('确认要解锁吗？', function(index) {
				var data = {};
				data.id = id;
				//后台请求保存数据
				$.axse("${basePath}/admin/startadm.do",  data, function(d){
					if(d.resultCode == 200){
						layer.msg('已解锁!', {
							icon : 1,
							time : 1000
						});
						location.replace(location.href);
					}else{
						layer.msg('解锁失败,请重试!', {
							icon : 1,
							time : 1000
						});
					}
				},
				function(d){
					layer.msg('启用失败,请重试!', {
						icon : 1,
						time : 1000
					});
				});
			});
		}
		
	
	</script>
</body>
</html>